<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>用户打卡管理系统</title>
  <link href="../static/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="../static/bootstrap-icons/font/bootstrap-icons.css">
  <style>
    :root {
      --primary-color: #3498db;
      --secondary-color: #2ecc71;
      --accent-color: #9b59b6;
      --light-color: #f8f9fa;
      --dark-color: #2c3e50;
      --text-color: #34495e;
      --border-color: #e0e0e0;
      --border-radius: 12px;
      --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    body {
      font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
      background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
      min-height: 100vh;
      color: var(--text-color);
      line-height: 1.6;
    }

    .container {
      max-width: 1400px;
      margin: 0 auto;
      padding: 20px;
    }

    /* 头部样式 */
    .header {
      text-align: center;
      margin-bottom: 30px;
      padding: 30px 0;
    }

    .header h1 {
      color: var(--dark-color);
      font-size: 2.2rem;
      font-weight: 300;
      margin-bottom: 10px;
      letter-spacing: 1px;
    }

    .header p {
      color: #7f8c8d;
      font-size: 1.1rem;
      font-weight: 300;
    }

    /* 工具栏样式 */
    .toolbar {
      background: white;
      padding: 20px;
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      margin-bottom: 25px;
      border: 1px solid var(--border-color);
    }

    .search-group {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
    }

    .form-control {
      padding: 10px 15px;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      font-size: 14px;
      transition: all 0.3s ease;
      background: var(--light-color);
      min-width: 150px;
    }

    .form-control:focus {
      border-color: var(--primary-color);
      box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
      outline: none;
      background: white;
    }

    .btn-search {
      background: var(--primary-color);
      color: white;
      border: none;
      padding: 10px 20px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-search:hover {
      background: #2980b9;
      transform: translateY(-1px);
    }

    /* 卡片容器样式 */
    .cards-container {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
      gap: 25px;
      margin-bottom: 30px;
    }

    .checkin-card {
      background: white;
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      overflow: hidden;
      transition: all 0.3s ease;
      border: 1px solid var(--border-color);
    }

    .checkin-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    }

    .card-header {
      padding: 20px 20px 15px;
      border-bottom: 1px solid var(--border-color);
      background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    }

    .card-id {
      font-weight: 600;
      color: var(--primary-color);
      font-size: 14px;
      margin-bottom: 8px;
    }

    .card-status {
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      display: inline-block;
    }

    .status-shared {
      background: #d5f4e6;
      color: #27ae60;
      border: 1px solid #2ecc71;
    }

    .status-private {
      background: #fdeaea;
      color: #e74c3c;
      border: 1px solid #e74c3c;
    }

    .card-body {
      padding: 20px;
    }

    .user-info {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 15px;
    }

    .user-avatar {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
      display: flex;
      align-items: center;
      justify-content: center;
      color: white;
      font-weight: 600;
      font-size: 16px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .user-details h3 {
      font-size: 16px;
      font-weight: 600;
      margin-bottom: 2px;
      color: var(--dark-color);
    }

    .user-details p {
      font-size: 12px;
      color: #7f8c8d;
    }

    .card-content {
      margin-bottom: 20px;
    }

    .content-text {
      background: #f8f9fa;
      padding: 15px;
      border-radius: 8px;
      font-size: 14px;
      line-height: 1.6;
      color: var(--text-color);
      border-left: 3px solid var(--primary-color);
    }

    /* 轮播图样式 */
    .carousel-container {
      margin-bottom: 20px;
      border-radius: 8px;
      overflow: hidden;
      position: relative;
      background: #f8f9fa;
    }

    .carousel-slides {
      display: flex;
      transition: transform 0.5s ease;
    }

    .carousel-slide {
      min-width: 100%;
      height: 200px;
      position: relative;
    }

    .carousel-slide img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .carousel-controls {
      position: absolute;
      top: 50%;
      width: 100%;
      display: flex;
      justify-content: space-between;
      padding: 0 10px;
      transform: translateY(-50%);
    }

    .carousel-btn {
      background: rgba(255, 255, 255, 0.8);
      border: none;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.3s ease;
      color: var(--dark-color);
      box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }

    .carousel-btn:hover {
      background: white;
      transform: scale(1.1);
    }

    .carousel-indicators {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      gap: 6px;
    }

    .indicator {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.5);
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .indicator.active {
      background: white;
      transform: scale(1.2);
    }

    .no-images {
      height: 120px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #95a5a6;
      font-size: 14px;
      background: #f8f9fa;
      border-radius: 8px;
    }

    .card-stats {
      display: flex;
      gap: 15px;
      margin-bottom: 20px;
    }

    .stat-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 8px 12px;
      background: #f8f9fa;
      border-radius: 8px;
      flex: 1;
    }

    .stat-icon {
      color: var(--primary-color);
      font-size: 14px;
    }

    .stat-value {
      font-weight: 600;
      font-size: 16px;
      color: var(--dark-color);
    }

    .stat-label {
      font-size: 12px;
      color: #7f8c8d;
    }

    .card-footer {
      padding: 15px 20px;
      border-top: 1px solid var(--border-color);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f8f9fa;
    }

    .card-date {
      font-size: 12px;
      color: #7f8c8d;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .card-actions {
      display: flex;
      gap: 8px;
    }

    .btn-action {
      padding: 6px 12px;
      border: none;
      border-radius: 6px;
      font-size: 12px;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 4px;
      transition: all 0.2s ease;
      font-weight: 500;
    }

    .btn-view {
      background: var(--primary-color);
      color: white;
    }

    .btn-edit {
      background: var(--secondary-color);
      color: white;
    }

    .btn-delete {
      background: #e74c3c;
      color: white;
    }

    .btn-action:hover {
      opacity: 0.9;
      transform: translateY(-1px);
    }

    /* 分页器样式 */
    .pagination-controls {
      background: white;
      padding: 20px;
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      display: flex;
      justify-content: space-between;
      align-items: center;
      border: 1px solid var(--border-color);
    }

    .page-size-selector {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-size-selector label {
      font-size: 14px;
      color: var(--text-color);
    }

    .pagination {
      display: flex;
      align-items: center;
      gap: 5px;
    }

    .page-btn {
      width: 36px;
      height: 36px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border-color);
      border-radius: 6px;
      background: white;
      cursor: pointer;
      transition: all 0.2s ease;
      font-size: 14px;
    }

    .page-btn:hover {
      border-color: var(--primary-color);
      color: var(--primary-color);
    }

    .page-btn.active {
      background: var(--primary-color);
      border-color: var(--primary-color);
      color: white;
    }

    .page-btn.disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    .page-numbers {
      display: flex;
      gap: 5px;
    }

    /* 空状态样式 */
    .empty-state {
      text-align: center;
      padding: 60px 40px;
      grid-column: 1 / -1;
      background: white;
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
    }

    .empty-state i {
      font-size: 64px;
      color: #bdc3c7;
      margin-bottom: 20px;
    }

    .empty-state h3 {
      font-size: 20px;
      color: #7f8c8d;
      margin-bottom: 10px;
      font-weight: 300;
    }

    .empty-state p {
      color: #95a5a6;
      font-size: 14px;
    }

    /* 响应式调整 */
    @media (max-width: 768px) {
      .cards-container {
        grid-template-columns: 1fr;
        gap: 20px;
      }

      .search-group {
        flex-direction: column;
      }

      .pagination-controls {
        flex-direction: column;
        gap: 15px;
      }

      .header h1 {
        font-size: 1.8rem;
      }
    }

    /* 滚动条样式 */
    ::-webkit-scrollbar {
      width: 6px;
    }

    ::-webkit-scrollbar-track {
      background: #f1f1f1;
    }

    ::-webkit-scrollbar-thumb {
      background: #c1c1c1;
      border-radius: 3px;
    }

    ::-webkit-scrollbar-thumb:hover {
      background: #a8a8a8;
    }
    /* 模态框样式 */
    .modal {
      display: none;
      position: fixed;
      z-index: 1000;
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      background-color: rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(5px);
      animation: fadeIn 0.3s ease;
    }

    .modal-content {
      background-color: white;
      margin: 2% auto;
      border-radius: var(--border-radius);
      box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
      width: 90%;
      max-width: 600px;
      max-height: 90vh;
      overflow: hidden;
      animation: slideIn 0.3s ease;
      display: flex;
      flex-direction: column;
    }

    .modal-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px 25px;
      border-bottom: 1px solid var(--border-color);
      background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    }

    .modal-header h3 {
      color: var(--dark-color);
      font-weight: 600;
      margin: 0;
      font-size: 1.3rem;
    }

    .close-btn {
      background: none;
      border: none;
      font-size: 24px;
      cursor: pointer;
      color: #7f8c8d;
      transition: all 0.3s ease;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
    }

    .close-btn:hover {
      color: var(--dark-color);
      background: rgba(0, 0, 0, 0.05);
    }

    .modal-body {
      padding: 25px;
      overflow-y: auto;
      flex: 1;
    }

    /* 详情内容样式 */
    .detail-section {
      margin-bottom: 25px;
    }

    .detail-section:last-child {
      margin-bottom: 0;
    }

    .detail-section h4 {
      color: var(--dark-color);
      font-size: 16px;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 2px solid var(--primary-color);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .detail-section h4 i {
      color: var(--primary-color);
    }

    .detail-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 15px;
    }

    .detail-item {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .detail-label {
      font-size: 12px;
      color: #7f8c8d;
      font-weight: 500;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .detail-value {
      font-size: 14px;
      color: var(--text-color);
      font-weight: 500;
      padding: 8px 12px;
      background: #f8f9fa;
      border-radius: 6px;
      border-left: 3px solid var(--primary-color);
    }

    .detail-content {
      background: #f8f9fa;
      padding: 15px;
      border-radius: 8px;
      border-left: 3px solid var(--secondary-color);
      font-size: 14px;
      line-height: 1.6;
      white-space: pre-wrap;
      word-wrap: break-word;
    }

    /* 图片预览样式 */
    .images-preview {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
      gap: 10px;
      margin-top: 10px;
    }

    .image-item {
      position: relative;
      aspect-ratio: 1;
      border-radius: 8px;
      overflow: hidden;
      background: #f8f9fa;
      cursor: pointer;
      transition: all 0.3s ease;
    }

    .image-item:hover {
      transform: scale(1.05);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .image-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .image-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      color: #95a5a6;
      font-size: 12px;
      background: #e9ecef;
    }

    /* 状态标签样式 */
    .status-badge {
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }

    .status-shared {
      background: #d5f4e6;
      color: #27ae60;
      border: 1px solid #2ecc71;
    }

    .status-private {
      background: #fdeaea;
      color: #e74c3c;
      border: 1px solid #e74c3c;
    }

    /* 动画 */
    @keyframes fadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

    @keyframes slideIn {
      from {
        opacity: 0;
        transform: translateY(-50px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    /* 响应式调整 */
    @media (max-width: 768px) {
      .modal-content {
        margin: 5% auto;
        width: 95%;
      }

      .detail-grid {
        grid-template-columns: 1fr;
        gap: 10px;
      }

      .modal-body {
        padding: 20px;
      }
    }
    /* 提示框基础样式 */
    .alert {
      position: fixed;
      top: 20px;
      right: 20px;
      z-index: 9999;
      min-width: 300px;
      max-width: 500px;
      border-radius: var(--border-radius);
      box-shadow: var(--shadow);
      padding: 0;
      opacity: 0;
      transform: translateX(100%);
      transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
      pointer-events: none;
    }

    .alert.show {
      opacity: 1;
      transform: translateX(0);
      pointer-events: all;
    }

    .alert-content {
      display: flex;
      align-items: center;
      padding: 16px 20px;
      border-radius: var(--border-radius);
      position: relative;
      overflow: hidden;
    }

    .alert-content::before {
      content: '';
      position: absolute;
      left: 0;
      top: 0;
      bottom: 0;
      width: 4px;
      background: currentColor;
      opacity: 0.8;
    }

    /* 成功提示框样式 */
    .alert-success {
      background: linear-gradient(135deg, #d5f4e6, #e8f8f0);
      border: 1px solid #2ecc71;
      color: #27ae60;
    }

    .alert-success .alert-content::before {
      background: #27ae60;
    }

    /* 错误提示框样式 */
    .alert-error {
      background: linear-gradient(135deg, #fdeaea, #fef2f2);
      border: 1px solid #e74c3c;
      color: #c0392b;
    }

    .alert-error .alert-content::before {
      background: #c0392b;
    }

    /* 提示图标 */
    .alert-icon {
      font-size: 20px;
      margin-right: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 24px;
      height: 24px;
    }

    /* 提示消息 */
    .alert-message {
      flex: 1;
      font-size: 14px;
      line-height: 1.5;
    }

    .alert-message strong {
      display: block;
      font-weight: 600;
      margin-bottom: 2px;
    }

    .alert-message span {
      display: block;
      font-weight: 400;
      opacity: 0.9;
    }

    /* 关闭按钮 */
    .alert-close {
      background: none;
      border: none;
      font-size: 18px;
      cursor: pointer;
      margin-left: 12px;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      transition: all 0.2s ease;
      opacity: 0.7;
      color: inherit;
    }

    .alert-close:hover {
      opacity: 1;
      background: rgba(0, 0, 0, 0.1);
      transform: scale(1.1);
    }

    /* 进度条动画 */
    .alert-progress {
      position: absolute;
      bottom: 0;
      left: 0;
      height: 3px;
      background: currentColor;
      opacity: 0.6;
      width: 100%;
      transform: scaleX(1);
      transform-origin: left;
      animation: progressBar 5s linear forwards;
    }

    @keyframes progressBar {
      from {
        transform: scaleX(1);
      }
      to {
        transform: scaleX(0);
      }
    }

    /* 响应式调整 */
    @media (max-width: 768px) {
      .alert {
        left: 10px;
        right: 10px;
        min-width: auto;
        max-width: none;
      }

      .alert-content {
        padding: 14px 16px;
      }
    }

    /* 动画变体 */
    .alert.slide-in {
      animation: slideInRight 0.4s ease-out forwards;
    }

    .alert.slide-out {
      animation: slideOutRight 0.4s ease-in forwards;
    }

    @keyframes slideInRight {
      from {
        opacity: 0;
        transform: translateX(100%);
      }
      to {
        opacity: 1;
        transform: translateX(0);
      }
    }

    @keyframes slideOutRight {
      from {
        opacity: 1;
        transform: translateX(0);
      }
      to {
        opacity: 0;
        transform: translateX(100%);
      }
    }

    /* 悬停暂停动画 */
    .alert:hover .alert-progress {
      animation-play-state: paused;
    }
  </style>
</head>
<body>
<!-- 成功提示框 -->
<div id="success-alert" class="alert alert-success">
  <div class="alert-content">
    <div class="alert-icon">
      <i class="bi bi-check-circle-fill"></i>
    </div>
    <div class="alert-message">
      <strong>成功!</strong>
      <span id="success-message">操作已成功完成</span>
    </div>
    <button class="alert-close" onclick="hideSuccessAlert()">
      <i class="bi bi-x"></i>
    </button>
  </div>
</div>

<!-- 错误提示框 -->
<div id="error-alert" class="alert alert-error">
  <div class="alert-content">
    <div class="alert-icon">
      <i class="bi bi-exclamation-circle-fill"></i>
    </div>
    <div class="alert-message">
      <strong>错误!</strong>
      <span id="error-message">操作过程中出现错误</span>
    </div>
    <button class="alert-close" onclick="hideErrorAlert()">
      <i class="bi bi-x"></i>
    </button>
  </div>
</div>
<div class="container">

  <!-- 工具栏 -->
  <div class="toolbar">
    <div class="search-group">
      <input type="text" class="form-control" id="userIdFilter" placeholder="用户名称">
      <input type="text" class="form-control" id="shopIdFilter" placeholder="店铺名称">
      <input type="text" class="form-control" id="scriptIdFilter" placeholder="剧本名称">
      <select class="form-control" id="sharedFilter">
        <option value="">所有状态</option>
        <option value="1">已分享</option>
        <option value="0">未分享</option>
      </select>
      <button class="btn-search" id="searchBtn">
        <i class="bi bi-search"></i> 搜索
      </button>
    </div>
  </div>

  <!-- 卡片容器 -->
  <div class="cards-container" id="cardsContainer">
    <!-- 卡片将通过JS动态加载 -->
  </div>

  <!-- 分页器 -->
  <div class="pagination-controls">
    <div class="page-size-selector">
      <label for="pageSize">每页显示:</label>
      <select id="pageSize" class="form-control">
        <option value="6">6条</option>
        <option value="12" selected>12条</option>
        <option value="24">24条</option>
      </select>
    </div>

    <div class="pagination">
      <button class="page-btn" id="prevPage"><i class="bi bi-chevron-left"></i></button>
      <div class="page-numbers" id="pageNumbers">
        <!-- 页码将通过JS动态生成 -->
      </div>
      <button class="page-btn" id="nextPage"><i class="bi bi-chevron-right"></i></button>
    </div>
  </div>
  <!-- 详情模态框 -->
  <div id="detailModal" class="modal">
    <div class="modal-content">
      <div class="modal-header">
        <h3>打卡详情</h3>
        <button class="close-btn" id="closeModal">&times;</button>
      </div>
      <div class="modal-body" id="modalBody">
        <!-- 内容将通过JS动态填充 -->
      </div>
    </div>
  </div>
</div>
<script src="../static/js/jquery.js"></script>
<script src="../static/js/jquery.cookie.js"></script>
<script src="../static/js/user-checkin-management.js"></script>
</body>
</html>